//数据渲染
function showData(pageNum) {
  $('tbody').html('')
  let showData = resultData.slice((pageNum - 1) * eachNum, pageNum * eachNum)
  showData.forEach(item => {
    $('tbody').append(`
      <tr>
        <td>${item.tsbh}</td>
        <td>${item.jyts}</td>
        <td>${item.zz}</td>
        <td>${item.cbs}</td>
        <td>${item.lb}</td>
        <td>${item.zgsl}</td>
        <td>${item.wjsl}</td>
        <td>${item.dssl}</td>
        <td>${item.zl}</td>
        <td>${item.szsk}</td>
        <td>${item.rkrq}</td>
      </tr>
    `)
  })
}
//查询数据
function enquiryData() {
  if ($('#entext').val() != '') {
    resultData = []
    for (let i = 0; i < bookData.length; i++) {
      if (bookData[i].tsbh.match($('#entext').val()) ||
        bookData[i].jyts.match($('#entext').val()) ||
        bookData[i].zz.match($('#entext').val()) ||
        bookData[i].cbs.match($('#entext').val())) {
        resultData.push(bookData[i])
      }
    }
  } else {
    resultData = bookData
  }
  nowPageNum = 1
  maxPage = Math.ceil(resultData.length / eachNum)
  showPage(maxPage)
  goPage(nowPageNum)
}